**************************************
***********Replication file***********
****When Strength Becomes Weakness****
****Comparative Political Studies*****
***********Casper Sakstrup************
**************************************

*Set current folder as working directory.
*For example: cd "C:\Some folder\Strength Weakness replication"

*Open dataset
use "data_strengthweakness.dta", clear




**************************************
**************ARTICLE*****************
**************************************


**************FIGURE 1****************
*Requires the spmap package: ssc install spmap
*Execute all lines together, from "preserve" to "restore"
preserve
drop if precol==.
merge 1:1 ccode using id_map.dta
drop if _merge==2
*generate map
spmap precol using worldcoord, id(id) fcolor(Greys) ndfcolor(black) clmethod(custom) clbreaks(0 0.0001 0.25 0.50 0.75 1) legend(label(2 "0") label(3 ">0≤0.25") label(4 ">0.25≤0.50") label(5 ">0.50≤0.75") label(6 ">0.75≤1.0")) legend(size(large))
restore


**************TABLE 1*****************
*Model 1
logit conflict precol latitude EDE, robust
*Model 2
logit conflict precol latitude EDE navdist landdist, robust
margins, at(precol=(0 0.80913041))
*Model 3
reg conflictshare precol latitude EDE, robust
*Model 4
reg conflictshare precol latitude EDE navdist landdist, robust
margins, at(precol=(0 0.80913041))


**************TABLE 2*****************
*Model 1 and Model 2
ivprobit conflict latitude EDE (precol=agriyears), vce(robust) first
*Model 3 and Model 4
ivprobit conflict latitude EDE navdist landdist (precol=agriyears), vce(robust) first
margins, at (precol=(0 0.80913041)) predict(pr)


**************TABLE 3*****************
*Model 1 and Model 2
ivregress 2sls conflictshare latitude EDE (precol=agriyears), vce(robust) small first
*Model 3 and Model 4
ivregress 2sls conflictshare latitude EDE navdist landdist (precol=agriyears), vce(robust) small first
margins, at(precol=(0 0.80913041))
*Kleibergen-Paap rk LM (Chi2 test) and Kleibergen-Paap rk Wald F statistic
*Requires the ivreg2 package: ssc install ivreg2
ivreg2 conflictshare latitude EDE (precol=agriyears), robust small
ivreg2 conflictshare latitude EDE navdist landdist (precol=agriyears), robust small


**************TABLE 4*****************
*Requires the khb package: ssc install khb

*Logit (left-hand column)
*Execute all lines together to obtain p-values
khb logit conflict precol  ||  v2svstterr2 ef v2x_polyarchy e_migdppcln e_mipopulaln maxhighx maxlowx, concomitant(latitude EDE navdist landdist) summary disentangle
*P-values
*v2svstterr2
local v2svstterr2_coef = e(disentangle)[1,1]
local v2svstterr2_se = e(disentangle)[1,2]
display 2*normal(-abs(`v2svstterr2_coef'/`v2svstterr2_se'))
*ef
local ef_coef = e(disentangle)[2,1]
local ef_se = e(disentangle)[2,2]
display 2*normal(-abs(`ef_coef'/`ef_se'))
*v2x_polyarchy
local v2x_polyarchy_coef = e(disentangle)[3,1]
local v2x_polyarchy_se = e(disentangle)[3,2]
display 2*normal(-abs(`v2x_polyarchy_coef'/`v2x_polyarchy_se'))
*e_migdppcln
local e_migdppcln_coef = e(disentangle)[4,1]
local e_migdppcln_se = e(disentangle)[4,2]
display 2*normal(-abs(`e_migdppcln_coef'/`e_migdppcln_se'))
*e_mipopulaln
local e_mipopulaln_coef = e(disentangle)[5,1]
local e_mipopulaln_se = e(disentangle)[5,2]
display 2*normal(-abs(`e_mipopulaln_coef'/`e_mipopulaln_se'))
*maxhighx
local maxhighx_coef = e(disentangle)[6,1]
local maxhighx_se = e(disentangle)[6,2]
display 2*normal(-abs(`maxhighx_coef'/`maxhighx_se'))
*maxlowx
local maxlowx_coef = e(disentangle)[7,1]
local maxlowx_se = e(disentangle)[7,2]
display 2*normal(-abs(`maxlowx_coef'/`maxlowx_se'))

*OLS (right-hand column)
*Execute all lines together to obtain p-values
khb regress conflictshare precol  ||  v2svstterr2 ef v2x_polyarchy e_migdppcln e_mipopulaln maxhighx maxlowx, concomitant(latitude EDE navdist landdist) summary disentangle
*P-values
*v2svstterr2
local v2svstterr2_coef = e(disentangle)[1,1]
local v2svstterr2_se = e(disentangle)[1,2]
display 2*normal(-abs(`v2svstterr2_coef'/`v2svstterr2_se'))
*ef
local ef_coef = e(disentangle)[2,1]
local ef_se = e(disentangle)[2,2]
display 2*normal(-abs(`ef_coef'/`ef_se'))
*v2x_polyarchy
local v2x_polyarchy_coef = e(disentangle)[3,1]
local v2x_polyarchy_se = e(disentangle)[3,2]
display 2*normal(-abs(`v2x_polyarchy_coef'/`v2x_polyarchy_se'))
*e_migdppcln
local e_migdppcln_coef = e(disentangle)[4,1]
local e_migdppcln_se = e(disentangle)[4,2]
display 2*normal(-abs(`e_migdppcln_coef'/`e_migdppcln_se'))
*e_mipopulaln
local e_mipopulaln_coef = e(disentangle)[5,1]
local e_mipopulaln_se = e(disentangle)[5,2]
display 2*normal(-abs(`e_mipopulaln_coef'/`e_mipopulaln_se'))
*maxhighx
local maxhighx_coef = e(disentangle)[6,1]
local maxhighx_se = e(disentangle)[6,2]
display 2*normal(-abs(`maxhighx_coef'/`maxhighx_se'))
*maxlowx
local maxlowx_coef = e(disentangle)[7,1]
local maxlowx_se = e(disentangle)[7,2]
display 2*normal(-abs(`maxlowx_coef'/`maxlowx_se'))




**************************************
**************APPENDIX****************
**************************************


**************TABLE A1****************
sum conflict conflictshare precol agriyears latitude EDE navdist landdist v2svstterr2 ef v2x_polyarchy e_migdppcln e_mipopulaln maxhighx maxlowx


**************TABLE B1****************
*Model 1
logit conflict precol_alt1 latitude EDE, robust
*Model 2
logit conflict precol_alt1 latitude EDE navdist landdist, robust
*Model 3
reg conflictshare precol_alt1 latitude EDE, robust
*Model 4
reg conflictshare precol_alt1 latitude EDE navdist landdist, robust


**************TABLE B2****************
*Model 1 and Model 2
ivprobit conflict latitude EDE (precol_alt1=agriyears), vce(robust) first
*Model 3 and Model 4
ivprobit conflict latitude EDE navdist landdist (precol_alt1=agriyears), vce(robust) first


**************TABLE B3****************
*Model 1 and Model 2
ivregress 2sls conflictshare latitude EDE (precol_alt1=agriyears), vce(robust) small first
*Model 3 and Model 4
ivregress 2sls conflictshare latitude EDE navdist landdist (precol_alt1=agriyears), vce(robust) small first


**************TABLE B4****************
*Model 1
logit conflict precol_alt2 latitude EDE, robust
*Model 2
logit conflict precol_alt2 latitude EDE navdist landdist, robust
*Model 3
reg conflictshare precol_alt2 latitude EDE, robust
*Model 4
reg conflictshare precol_alt2 latitude EDE navdist landdist, robust


**************TABLE B5****************
*Model 1 and Model 2
ivprobit conflict latitude EDE (precol_alt2=agriyears), vce(robust) first
*Model 3 and Model 4
ivprobit conflict latitude EDE navdist landdist (precol_alt2=agriyears), vce(robust) first


**************TABLE B6****************
*Model 1 and Model 2
ivregress 2sls conflictshare latitude EDE (precol_alt2=agriyears), vce(robust) small first
*Model 3 and Model 4
ivregress 2sls conflictshare latitude EDE navdist landdist (precol_alt2=agriyears), vce(robust) small first


**************TABLE B7****************
*Model 1
logit conflict precol_alt3 latitude EDE, robust
*Model 2
logit conflict precol_alt3 latitude EDE navdist landdist, robust
*Model 3
reg conflictshare precol_alt3 latitude EDE, robust
*Model 4
reg conflictshare precol_alt3 latitude EDE navdist landdist, robust


**************TABLE B8****************
*Model 1 and Model 2
ivprobit conflict latitude EDE (precol_alt3=agriyears), vce(robust) first
*Model 3 and Model 4
ivprobit conflict latitude EDE navdist landdist (precol_alt3=agriyears), vce(robust) first


**************TABLE B9****************
*Model 1 and Model 2
ivregress 2sls conflictshare latitude EDE (precol_alt3=agriyears), vce(robust) small first
*Model 3 and Model 4
ivregress 2sls conflictshare latitude EDE navdist landdist (precol_alt3=agriyears), vce(robust) small first


**************TABLE C1****************
*Model 1
logit conflict precol latitude logem4 navdist landdist, robust
*Model2 
logit conflict precol latitude EDE navdist landdist Log_Elevation Log_Rainfall Humidity Temperature_Avg, robust
*Model 3
logit conflict precol latitude EDE navdist landdist Log_Elevation Log_Rainfall Humidity Temperature_Avg steplow deslow stepmid desmid drystep drywint, robust
*Model 4
reg conflictshare precol latitude logem4 navdist landdist, robust
*Model 5
reg conflictshare precol latitude EDE navdist landdist Log_Elevation Log_Rainfall Humidity Temperature_Avg, robust
*Model 6
reg conflictshare precol latitude EDE navdist landdist Log_Elevation Log_Rainfall Humidity Temperature_Avg steplow deslow stepmid desmid drystep drywint, robust


**************TABLE C2****************
*Model 1 and Model 2
ivprobit conflict latitude logem4 navdist landdist (precol=agriyears), vce(robust) first
*Model 3 and Model 4
ivprobit conflict latitude EDE navdist landdist Log_Elevation Log_Rainfall Humidity Temperature_Avg (precol=agriyears), vce(robust) first
*Model 5 and Model 6
ivprobit conflict latitude EDE navdist landdist Log_Elevation Log_Rainfall Humidity Temperature_Avg steplow deslow stepmid desmid drystep drywint (precol=agriyears), vce(robust) first


**************TABLE C3****************
*Model 1 and Model 2
ivregress 2sls conflictshare latitude logem4 navdist landdist (precol=agriyears), vce(robust) small first
*Model 3 and Model 4
ivregress 2sls conflictshare latitude EDE navdist landdist Log_Elevation Log_Rainfall Humidity Temperature_Avg (precol=agriyears), vce(robust) small first
*Model 5 and Model 6
ivregress 2sls conflictshare latitude EDE navdist landdist Log_Elevation Log_Rainfall Humidity Temperature_Avg steplow deslow stepmid desmid drystep drywint (precol=agriyears), vce(robust) small first


**************TABLE D1****************
*Model 1
logit conflict precol latitude EDE agriyears, robust
*Model 2
logit conflict precol latitude EDE navdist landdist agriyears, robust
*Model 3
reg conflictshare precol latitude EDE agriyears, robust
*Model 4
reg conflictshare precol latitude EDE navdist landdist agriyears, robust


**************TABLE E1****************
*Model 1
logit conflict precol latitude EDE if europe !=1, robust
*Model 2
logit conflict precol latitude EDE navdist landdist if europe !=1, robust
*Model 3
reg conflictshare precol latitude EDE if europe !=1, robust
*Model 4
reg conflictshare precol latitude EDE navdist landdist if europe !=1, robust


**************TABLE E2****************
*Model 1 and Model 2
ivprobit conflict latitude EDE (precol=agriyears) if europe !=1, vce(robust) first
*Model 3 and Model 4
ivprobit conflict latitude EDE navdist landdist (precol=agriyears) if europe !=1, vce(robust) first

**************TABLE E3****************
*Model 1 and Model 2
ivregress 2sls conflictshare latitude EDE (precol=agriyears) if europe !=1, vce(robust) small first
*Model 3 and Model 4
ivregress 2sls conflictshare latitude EDE navdist landdist (precol=agriyears) if europe !=1, vce(robust) small first


**************TABLE F1****************
*Model 1. Influential observations: Armenia, Benin, Ecuador, Vietnam, Japan, Chile, USA, South Korea, Singapore
gen infl1=.
replace infl1=1 if ccode==371 | ccode==434 | ccode==130 | ccode==816 | ccode==740 | ccode==155 | ccode==2 | ccode==732 | ccode==830
logit conflict precol latitude EDE if infl1 !=1, robust
*Model 2. Influential observations: Chile, USA, Guyana, Singapore, Philippines, Cape Verde, South Korea, Benin, Ecuador, Vietnam, Armenia
gen infl2=.
replace infl2=1 if ccode==155 | ccode==2 | ccode==110 | ccode==830 | ccode==840 | ccode==402 | ccode==732 | ccode==434 | ccode==130 | ccode==816 | ccode==371
logit conflict precol latitude EDE navdist landdist if infl2 !=1, robust
*Model 3. Influential observations: Israel, India, Sudan, Ethiopia, Myanmar (Burma), Philippines, South Korea, Vietnam
gen infl3=.
replace infl3=1 if ccode==666 | ccode==750 | ccode==625 | ccode==530 | ccode==775 | ccode==840 | ccode==816 | ccode==732
reg conflictshare precol latitude EDE if infl3 !=1, robust
*Model 4. Influential observations: Israel, Ethiopia, Sudan, Myanmar (Burma), Philippines
gen infl4=.
replace infl4=1 if ccode==666 | ccode==750 | ccode==625 | ccode==530 | ccode==775 | ccode==840
reg conflictshare precol latitude EDE navdist landdist if infl4 !=1, robust


**************TABLE G1****************
*Model 1
logit conflict precol latitude EDE africa asia americas if europe !=1, robust
*Model 2
logit conflict precol latitude EDE navdist landdist africa asia americas if europe !=1, robust
*Model 3
reg conflictshare precol latitude EDE africa asia americas if europe !=1, robust
*Model 4
reg conflictshare precol latitude EDE navdist landdist africa asia americas if europe !=1, robust


**************TABLE G2****************
*Model 1 and Model 2
ivprobit conflict latitude EDE africa asia americas (precol=agriyears) if europe !=1, vce(robust) first
*Model 3 and Model 4
ivprobit conflict latitude EDE navdist landdist africa asia americas (precol=agriyears) if europe !=1, vce(robust) first


**************TABLE G3****************
*Model 1 and Model 2
ivregress 2sls conflictshare latitude EDE africa asia americas (precol=agriyears) if europe !=1, vce(robust) small first
*Model 3 and Model 4
ivregress 2sls conflictshare latitude EDE navdist landdist africa asia americas (precol=agriyears) if europe !=1, vce(robust) small first


**********EXCLUDING REGIONS***********
*Not shown in Appendix to save space
*Excluding Africa
logit conflict precol latitude EDE if europe !=1 & africa !=1, robust
logit conflict precol latitude EDE navdist landdist if europe !=1 & africa !=1, robust
reg conflictshare precol latitude EDE if europe !=1 & africa !=1, robust
reg conflictshare precol latitude EDE navdist landdist if europe !=1 & africa !=1, robust
ivprobit conflict latitude EDE (precol=agriyears) if europe !=1 & africa !=1, vce(robust) first
ivprobit conflict latitude EDE navdist landdist (precol=agriyears) if europe !=1 & africa !=1, vce(robust) first
ivregress 2sls conflictshare latitude EDE (precol=agriyears) if europe !=1 & africa !=1, vce(robust) small first
ivregress 2sls conflictshare latitude EDE navdist landdist (precol=agriyears) if europe !=1 & africa !=1, vce(robust) small first
*Excluding Asia
logit conflict precol latitude EDE if europe !=1 & asia !=1, robust
logit conflict precol latitude EDE navdist landdist if europe !=1 & asia !=1, robust
reg conflictshare precol latitude EDE if europe !=1 & asia !=1, robust
reg conflictshare precol latitude EDE navdist landdist if europe !=1 & asia !=1, robust
ivprobit conflict latitude EDE (precol=agriyears) if europe !=1 & asia !=1, vce(robust) first
ivprobit conflict latitude EDE navdist landdist (precol=agriyears) if europe !=1 & asia !=1, vce(robust) first
ivregress 2sls conflictshare latitude EDE (precol=agriyears) if europe !=1 & asia !=1, vce(robust) small first
ivregress 2sls conflictshare latitude EDE navdist landdist (precol=agriyears) if europe !=1 & asia !=1, vce(robust) small first
*Excluding Americas
logit conflict precol latitude EDE if europe !=1 & americas !=1, robust
logit conflict precol latitude EDE navdist landdist if europe !=1 & americas !=1, robust
reg conflictshare precol latitude EDE if europe !=1 & americas !=1, robust
reg conflictshare precol latitude EDE navdist landdist if europe !=1 & americas !=1, robust
ivprobit conflict latitude EDE (precol=agriyears) if europe !=1 & americas !=1, vce(robust) first
ivprobit conflict latitude EDE navdist landdist (precol=agriyears) if europe !=1 & americas !=1, vce(robust) first
ivregress 2sls conflictshare latitude EDE (precol=agriyears) if europe !=1 & americas !=1, vce(robust) small first
ivregress 2sls conflictshare latitude EDE navdist landdist (precol=agriyears) if europe !=1 & americas !=1, vce(robust) small first
*Excluding MENA
logit conflict precol latitude EDE if europe !=1 & mena !=1, robust
logit conflict precol latitude EDE navdist landdist if europe !=1 & mena !=1, robust
reg conflictshare precol latitude EDE if europe !=1 & mena !=1, robust
reg conflictshare precol latitude EDE navdist landdist if europe !=1 & mena !=1, robust
ivprobit conflict latitude EDE (precol=agriyears) if europe !=1 & mena !=1, vce(robust) first
ivprobit conflict latitude EDE navdist landdist (precol=agriyears) if europe !=1 & mena !=1, vce(robust) first
ivregress 2sls conflictshare latitude EDE (precol=agriyears) if europe !=1 & mena !=1, vce(robust) small first
ivregress 2sls conflictshare latitude EDE navdist landdist (precol=agriyears) if europe !=1 & mena !=1, vce(robust) small first


**************TABLE H1****************
*Model 1
logit conflict precol latitude EDE if neoeurope !=1, robust
*Model 2
logit conflict precol latitude EDE navdist landdist if neoeurope !=1, robust
*Model 3
reg conflictshare precol latitude EDE if neoeurope !=1, robust
*Model 4
reg conflictshare precol latitude EDE navdist landdist if neoeurope !=1, robust


**************TABLE H2****************
*Model 1 and Model 2
ivprobit conflict latitude EDE (precol=agriyears) if neoeurope !=1, vce(robust) first
*Model 3 and Model 4
ivprobit conflict latitude EDE navdist landdist (precol=agriyears) if neoeurope !=1, vce(robust) first


**************TABLE H3****************
*Model 1 and Model 2
ivregress 2sls conflictshare latitude EDE (precol=agriyears) if neoeurope !=1, vce(robust) small first
*Model 3 and Model 4
ivregress 2sls conflictshare latitude EDE navdist landdist (precol=agriyears) if neoeurope !=1, vce(robust) small first

